/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ucb.sispro.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author felipe
 */
@Entity
@Table(name = "respostaavaliacao")
@NamedQueries({
    @NamedQuery(name = "RespostaAvaliacao.findAll", query = "SELECT r FROM RespostaAvaliacao r"),
    @NamedQuery(name = "RespostaAvaliacao.findByIdRespostaAvaliacao", query = "SELECT r FROM RespostaAvaliacao r WHERE r.idRespostaAvaliacao = :idRespostaAvaliacao"),
    @NamedQuery(name = "RespostaAvaliacao.findByResposta", query = "SELECT r FROM RespostaAvaliacao r WHERE r.resposta = :resposta")})
public class RespostaAvaliacao implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idRespostaAvaliacao")
    private Integer idRespostaAvaliacao;
    @Basic(optional = false)
    @Column(name = "resposta")
    private String resposta;
    @JoinColumn(name = "PerguntaAvaliacao_idPerguntaAvaliacao", referencedColumnName = "idPerguntaAvaliacao")
    @ManyToOne(optional = false)
    private PerguntaAvaliacao perguntaAvaliacaoidPerguntaAvaliacao;

    public RespostaAvaliacao() {
    }

    public RespostaAvaliacao(Integer idRespostaAvaliacao) {
        this.idRespostaAvaliacao = idRespostaAvaliacao;
    }

    public RespostaAvaliacao(Integer idRespostaAvaliacao, String resposta) {
        this.idRespostaAvaliacao = idRespostaAvaliacao;
        this.resposta = resposta;
    }

    public Integer getIdRespostaAvaliacao() {
        return idRespostaAvaliacao;
    }

    public void setIdRespostaAvaliacao(Integer idRespostaAvaliacao) {
        this.idRespostaAvaliacao = idRespostaAvaliacao;
    }

    public String getResposta() {
        return resposta;
    }

    public void setResposta(String resposta) {
        this.resposta = resposta;
    }

    public PerguntaAvaliacao getPerguntaAvaliacaoidPerguntaAvaliacao() {
        return perguntaAvaliacaoidPerguntaAvaliacao;
    }

    public void setPerguntaAvaliacaoidPerguntaAvaliacao(PerguntaAvaliacao perguntaAvaliacaoidPerguntaAvaliacao) {
        this.perguntaAvaliacaoidPerguntaAvaliacao = perguntaAvaliacaoidPerguntaAvaliacao;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idRespostaAvaliacao != null ? idRespostaAvaliacao.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RespostaAvaliacao)) {
            return false;
        }
        RespostaAvaliacao other = (RespostaAvaliacao) object;
        if ((this.idRespostaAvaliacao == null && other.idRespostaAvaliacao != null) || (this.idRespostaAvaliacao != null && !this.idRespostaAvaliacao.equals(other.idRespostaAvaliacao))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.ucb.sispro.model.RespostaAvaliacao[ idRespostaAvaliacao=" + idRespostaAvaliacao + " ]";
    }
    
}
